<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //通过Object直接创建对象
    //var p1 = new Object();//创建一个Object对象
    var p1 = {};//创建一个Object对象，简写
    //动态增加属性、方法
    p1.Name = "孤傲苍狼";
    p1.Age = 24;
    p1.SayHello = function() { alert("hello，"+p1.Name); };
    p1.SayHello();
    for(var propertyName in p1) {//对象的成员都是对象的key
        alert(propertyName);
    }
</script>
</body>
</html>